# 加法运算符
m = 10
n = 97
sum1 = m + n

x = 7.2
y = 15.3
sum2 = x + y

print("sum1 = %d, sum2 = %.2f" %(sum1, sum2))

print()

## 拼接字符串
name = "C语言中文网"
url = "http://c.biancheng.net/"
age = 8
info = name + "的网址是" + url + "，它已经" + str(age) + "岁了。"
print(info)

print()

# 减法运算符
n = 45
m = -n

x = -83.5
y = -x

print(m, ",", y)

print()

## 求负
n = 45
n_neg = -n

f = -83.5
f_neg = -f

print(n_neg, ",", f_neg)

print()

# 乘法运算符
n = 4 * 25
f = 34.5 * 2
print(n, ",", f)

## 重复字符
str1 = "hello "
print(str1 * 4)

print()

# 除法运算符
# 整数不能除尽
print("23 / 5 = ", 23 / 5)
print("23 // 5 = ", 23 // 5)
print("23.0 // 5 = ", 23.0 // 5)
print("----------------")

# 整数能除尽
print("25 / 5 = ", 25 / 5)
print("25 // 5 = ", 25 // 5)
print("25.0 // 5 = ", 25.0 // 5)
print("----------------")

# 小数除法
print("12.4 / 3.5 = ", 12.5 / 3.5)
print("12.4 // 3.5 = ", 12.4 // 3.5)

print()

# 求余运算符
print("--------整数求余--------")
print("15 % 6 = ", 15 % 6)
print("-15 % 6 = ", -15 % 6)
print("15 % -6", 15 % -6)
print("-15 % -6 =", -15 % -6)

print("--------小数求余--------")
print("7.7 % 2.2 = ", 7.7 % 2.2)
print("-7.7 % 2.2 = ", -7.7 % 2.2)
print("7.7 % -2.2 = ", 7.7 % -2.2)
print("-7.7 % -2.2 = ", -7.7 % -2.2)

print("--------整数和小数求余--------")
print("23.5 % 6 = ", 23.5 % 6)
print("23 % 6.5 = ", 23 % 6.5)
print("23.5 % -6 = ", 23.5 % -6)
print("-23 % 6.5 = ", -23 % 6.5)
print("-23 % -6.5 = ", -23 % -6.5)

print()

# 次方（乘方）运算符
print("--------次方运算--------")
print("3 ** 4 = ", 3 ** 4)
print("2 ** 5 = ", 2 ** 5)

print("----开方运算--------")
print("81 ** (1 / 4) = ", 81 ** (1 / 4))
print("32 ** (1 / 5) = ", 32 ** (1 / 5))
